/*
============================================================================
 Name        : C$(EngineBasename) from $(EngineBasename).h
 Author      : $(Author)
 Version     :
 Copyright   : $(Copyright)
 Description : C$(EngineBasename) DLL source
============================================================================
*/

//  Include Files  

#include "$(EngineBasename).h"	// C$(EngineBasename)
#include "$(EngineBasename).pan"      	// panic codes

//  Member Functions

EXPORT_C C$(EngineBasename)* C$(EngineBasename)::NewLC()
	{
	C$(EngineBasename)* self = new (ELeave) C$(EngineBasename);
	CleanupStack::PushL(self);
	self->ConstructL();
	return self;
	}


EXPORT_C C$(EngineBasename)* C$(EngineBasename)::NewL()
	{
	C$(EngineBasename)* self = C$(EngineBasename)::NewLC();
	CleanupStack::Pop(self);
	return self;
	}


C$(EngineBasename)::C$(EngineBasename)()
	{
	// note, CBase initialises all member variables to zero
	}


void C$(EngineBasename)::ConstructL()
	{
	// second phase constructor, anything that may leave must be constructed here
	iString = new (ELeave) T$(EngineBasename)ExampleString;
	}


EXPORT_C C$(EngineBasename)::~C$(EngineBasename)()
	{
	delete iString;
	}


EXPORT_C TVersion C$(EngineBasename)::Version() const
	{
	// Version number of example API
	const TInt KMajor = 1;
	const TInt KMinor = 0;
	const TInt KBuild = 1;
	return TVersion(KMajor, KMinor, KBuild);
	}


EXPORT_C void C$(EngineBasename)::ExampleFuncAddCharL(const TChar& aChar)
	{
	__ASSERT_ALWAYS(iString != NULL, Panic(E$(EngineBasename)NullPointer));

	if (iString->Length() >= K$(EngineBasename)BufferLength)
		{
		User::Leave(KErrTooBig);
		}

	iString->Append(aChar);
	}


EXPORT_C void C$(EngineBasename)::ExampleFuncRemoveLast()
	{
	__ASSERT_ALWAYS(iString != NULL, Panic(E$(EngineBasename)NullPointer));

	if (iString->Length() > 0)
		{
		iString->SetLength(iString->Length() - 1);
		}
	}
EXPORT_C void C$(EngineBasename)::ExampleFuncClearBuffer()
	{
	iString->Zero();
	}

EXPORT_C const TPtrC C$(EngineBasename)::ExampleFuncString() const
	{
	__ASSERT_ALWAYS(iString != NULL, Panic(E$(EngineBasename)NullPointer));
	return *iString;
	}
